import { createResolver } from '@nuxt/kit'
const { resolve } = createResolver(import.meta.url)

// https://nuxt.com/docs/api/configuration/nuxt-config

const API_URL = 'http://www.mihunter.com'

export default defineNuxtConfig({
  // exp
  experimental: {
    localLayerAliases: true,
  },

  // app config
  app: {
    // global transition
    pageTransition: { name: 'page', mode: 'out-in' },
    layoutTransition: { name: 'layout', mode: 'out-in' },
  },

  // typescripts
  // todo: feat/strict-type-check
  // typescript: {
  //   strict: true,
  //   typeCheck: true,
  // },

  // modules
  modules: [
    // '@pinia/nuxt',
    '@element-plus/nuxt',
    // todo: feat/localization
    // '@nuxtjs/i18n'
  ],
  elementPlus: {
    /** Options */
  },
  alias: {
    '@scss': resolve(__dirname, './assets/scss'),
    '@img': resolve(__dirname, './assets/images'),
  },
  css: [resolve('./assets/scss/common.scss')],

  components: [],

  imports: {
    dirs: [resolve('./stores'), '~/stores'],
  },

  // module::pinia
  pinia: {
    storesDirs: ['~/stores/**', '#/stores/**', '@/stores/**'],
  },
  runtimeConfig: {
    public: {
      API_URL,
    },
  },
  nitro: {
    devProxy: {
      '/api': {
        target: API_URL + '/api',
        changeOrigin: true,
        prependPath: true,
      },
    },
  },
})
